#pragma once



#define ACRE_SQUARE_INCH  155000,31
#define INCH_CM           2,54001


#undef GMP_USE

enum e_triangle
{
  _bottom,
  _left,
  _right
};


struct triangle_side //define the side of triangle, it is is pair of points
{
  e_triangle _side;
  POINT _p1;
  POINT _p2;
};

class Triangle
{
private:
  bool          m_initialized;
  POINT         m_points[3]; //triangle has a three points only
  triangle_side m_bottom; //Define the bottom of triangle, important to calculate the field and angles of triangle
  triangle_side m_right; //right side of triangle from bottom
  triangle_side m_left; //left side of triangle from bottom
  int           m_x_resolution;
  int           m_y_resolution;
#ifdef GMP_USE 
  mpf_t         m_side;
  mpf_t         m_area;
#else
  long double   m_area;
  long double   m_side;
#endif
public:
  Triangle(void);
  Triangle(const POINT *); //three elementary array
  ~Triangle(void);
protected:
#ifdef GMP_USE  
  mpf_t & GetLength(int);
#else
  long double & GetLength(int);
#endif

public:
#ifdef GMP_USE
  const mpf_t & Area();
#else
  const long double & Area(int x_resolution, int y_resolution); //Result is square inches
#endif
  float Angle(int, int); //Define sides between the angle has to be meassure
  void SetSide(const triangle_side &);
  void SetSides(const figureVertice *); //Three points array
  const triangle_side & GetSide(int);
  virtual void Draw(const HWND &, const POINT &);
};
